package com.jeecg.p3.dzdp.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import org.jeecgframework.p3.core.utils.common.PageList;
import org.jeecgframework.p3.core.utils.common.PageQuery;
import org.jeecgframework.p3.core.utils.common.Pagenation;
import com.jeecg.p3.dzdp.service.WxActDzdpRelationService;
import com.jeecg.p3.dzdp.entity.WxActDzdpRelation;
import com.jeecg.p3.dzdp.dao.WxActDzdpRelationDao;

@Service("wxActDzdpRelationService")
public class WxActDzdpRelationServiceImpl implements WxActDzdpRelationService {
	@Resource
	private WxActDzdpRelationDao wxActDzdpRelationDao;

	@Override
	public void doAdd(WxActDzdpRelation wxActDzdpRelation) {
		wxActDzdpRelationDao.add(wxActDzdpRelation);
	}

	@Override
	public void doEdit(WxActDzdpRelation wxActDzdpRelation) {
		wxActDzdpRelationDao.update(wxActDzdpRelation);
	}

	@Override
	public void doDelete(String id) {
		wxActDzdpRelationDao.delete(id);
	}

	@Override
	public WxActDzdpRelation queryById(String id) {
		WxActDzdpRelation wxActDzdpRelation  = wxActDzdpRelationDao.get(id);
		return wxActDzdpRelation;
	}

	@Override
	public PageList<WxActDzdpRelation> queryPageList(
		PageQuery<WxActDzdpRelation> pageQuery) {
		PageList<WxActDzdpRelation> result = new PageList<WxActDzdpRelation>();
		Integer itemCount = wxActDzdpRelationDao.count(pageQuery);
		List<WxActDzdpRelation> list = wxActDzdpRelationDao.queryPageList(pageQuery,itemCount);
		Pagenation pagenation = new Pagenation(pageQuery.getPageNo(), itemCount, pageQuery.getPageSize());
		result.setPagenation(pagenation);
		result.setValues(list);
		return result;
	}
	@Override
	public List<WxActDzdpRelation> queryByPropertyId(String propertyId){
		return wxActDzdpRelationDao.queryByPropertyId(propertyId);
	}
	
}
